package com.drinks.yiniang.entity.user.order;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.drinks.yiniang.entity.goods.GoodsJson;
import com.drinks.yiniang.entity.user.address.DeliverAddressJson;
import com.hansen.library.entity.BaseJson;

import java.util.List;

/**
 * 订单详情
 *
 * @author han
 * @date 2019/11/17
 */
public class OrderDetailJson extends BaseJson implements Cloneable {

    public static final int ITEM_TYPE_ORDER_DETAIL_ADDRESS = 0x01;//收货地址
    public static final int ITEM_TYPE_ORDER_DETAIL_DELIVERY = 0x02;//配送进度
    public static final int ITEM_TYPE_ORDER_DETAIL_LIST = 0x03;//订单商品
    public static final int ITEM_TYPE_ORDER_DETAIL_TOTAL = 0x04;//总计
    public static final int ITEM_TYPE_ORDER_DETAIL_LOGISTICS = 0x05;//物流信息
    public static final int ITEM_TYPE_ORDER_DETAIL_RECOMMEND_TITLE = 0x06;//标题
    public static final int ITEM_TYPE_ORDER_DETAIL_RECOMMEND = 0x07;//推荐的商品

    private OrderDetailData data;

    public OrderDetailData getData() {
        return data;
    }

    public void setData(OrderDetailData data) {
        this.data = data;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        OrderDetailJson data = (OrderDetailJson) super.clone();
        return data;
    }

    public static class OrderDetailData implements Cloneable {
        private String id;
        private String order_no;
        private String pay_amount;
        //订单状态 0待支付 1已支付 2已发货 3已送达 4交易完成 5已评价 6已取消 7退款仲裁（退款中） 9门店自提 10已退款 11拒绝退款 12缺货取消一品脱订单状态
        private String status;
        //是否自提 1-是
        private String self_get;
        //快递公司编码 1表示自营 其他为第三方快递
        private String out_cn;
        //快递公司名称
        private String out_name;
        //第三方快递单号
        private String out_order_no;
        //自营配送员
        private String courier;
        //配送员电话
        private String courier_mobile;
        //快递信息
        private OrderExpress express;
        //商品
        private List<OrderDetailList> goods;
        //收货地址
        private DeliverAddressJson.DeliverAddressData address;
        //门店地址
        private String stores_address;
        //门店信息
        private OrderDetailStores stores;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getOrder_no() {
            return order_no;
        }

        public void setOrder_no(String order_no) {
            this.order_no = order_no;
        }

        public String getPay_amount() {
            return pay_amount;
        }

        public void setPay_amount(String pay_amount) {
            this.pay_amount = pay_amount;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getSelf_get() {
            return self_get;
        }

        public void setSelf_get(String self_get) {
            this.self_get = self_get;
        }

        public String getOut_cn() {
            return out_cn;
        }

        public void setOut_cn(String out_cn) {
            this.out_cn = out_cn;
        }

        public String getOut_name() {
            return out_name;
        }

        public void setOut_name(String out_name) {
            this.out_name = out_name;
        }

        public String getOut_order_no() {
            return out_order_no;
        }

        public void setOut_order_no(String out_order_no) {
            this.out_order_no = out_order_no;
        }

        public String getCourier() {
            return courier;
        }

        public void setCourier(String courier) {
            this.courier = courier;
        }

        public String getCourier_mobile() {
            return courier_mobile;
        }

        public void setCourier_mobile(String courier_mobile) {
            this.courier_mobile = courier_mobile;
        }

        public OrderExpress getExpress() {
            return express;
        }

        public void setExpress(OrderExpress express) {
            this.express = express;
        }

        public List<OrderDetailList> getGoods() {
            return goods;
        }

        public void setGoods(List<OrderDetailList> goods) {
            this.goods = goods;
        }

        public DeliverAddressJson.DeliverAddressData getAddress() {
            return address;
        }

        public void setAddress(DeliverAddressJson.DeliverAddressData address) {
            this.address = address;
        }

        public OrderDetailStores getStores() {
            return stores;
        }

        public void setStores(OrderDetailStores stores) {
            this.stores = stores;
        }

        public String getStores_address() {
            return stores_address;
        }

        public void setStores_address(String stores_address) {
            this.stores_address = stores_address;
        }

        @Override
        public Object clone() throws CloneNotSupportedException {
            OrderDetailData data = (OrderDetailData) super.clone();
            return data;
        }
    }

    public static class OrderDetailList implements MultiItemEntity, Cloneable {

        private int mItemType = ITEM_TYPE_ORDER_DETAIL_LIST;
        //订单id
        private String order_id;
        //商品id(推荐商品使用)
        private String goods_id;
        private String goods_name;
        //商品价格(推荐商品使用)
        private String goods_price;
        //推荐商品的活动
        private List<GoodsJson.GoodsActivity> activity;
        private String pay_price;
        private String activity_amount;
        private String num;
        private String give_num;
        //容积
        private String single_capacity;
        private String goods_sku_name;
        private String goods_sku_value;
        private String cover_url;
        private String recommend_reason;
        //临时存储order data
        private OrderDetailData tempOrderData;
        //前端动态添加，是否显示全部物流细腻
        private boolean isShowAllExpress;

        public void setItemType(int mItemType) {
            this.mItemType = mItemType;
        }

        @Override
        public int getItemType() {
            switch (mItemType) {
                case ITEM_TYPE_ORDER_DETAIL_ADDRESS:
                case ITEM_TYPE_ORDER_DETAIL_DELIVERY:
                case ITEM_TYPE_ORDER_DETAIL_LOGISTICS:
                case ITEM_TYPE_ORDER_DETAIL_LIST:
                case ITEM_TYPE_ORDER_DETAIL_TOTAL:
                case ITEM_TYPE_ORDER_DETAIL_RECOMMEND_TITLE:
                case ITEM_TYPE_ORDER_DETAIL_RECOMMEND:
                    return mItemType;
                default:
                    return BaseMultiItemQuickAdapter.TYPE_NOT_FOUND;
            }
        }

        public String getOrder_id() {
            return order_id;
        }

        public void setOrder_id(String order_id) {
            this.order_id = order_id;
        }

        public String getGoods_id() {
            return goods_id;
        }

        public void setGoods_id(String goods_id) {
            this.goods_id = goods_id;
        }

        public String getGoods_name() {
            return goods_name;
        }

        public void setGoods_name(String goods_name) {
            this.goods_name = goods_name;
        }

        public String getGoods_price() {
            return goods_price;
        }

        public void setGoods_price(String goods_price) {
            this.goods_price = goods_price;
        }

        public List<GoodsJson.GoodsActivity> getActivity() {
            return activity;
        }

        public void setActivity(List<GoodsJson.GoodsActivity> activity) {
            this.activity = activity;
        }

        public String getPay_price() {
            return pay_price;
        }

        public void setPay_price(String pay_price) {
            this.pay_price = pay_price;
        }

        public String getActivity_amount() {
            return activity_amount;
        }

        public void setActivity_amount(String activity_amount) {
            this.activity_amount = activity_amount;
        }

        public String getNum() {
            return num;
        }

        public void setNum(String num) {
            this.num = num;
        }

        public String getGive_num() {
            return give_num;
        }

        public void setGive_num(String give_num) {
            this.give_num = give_num;
        }

        public String getSingle_capacity() {
            return single_capacity;
        }

        public void setSingle_capacity(String single_capacity) {
            this.single_capacity = single_capacity;
        }

        public String getGoods_sku_name() {
            return goods_sku_name;
        }

        public void setGoods_sku_name(String goods_sku_name) {
            this.goods_sku_name = goods_sku_name;
        }

        public String getGoods_sku_value() {
            return goods_sku_value;
        }

        public void setGoods_sku_value(String goods_sku_value) {
            this.goods_sku_value = goods_sku_value;
        }

        public String getCover_url() {
            return cover_url;
        }

        public void setCover_url(String cover_url) {
            this.cover_url = cover_url;
        }

        public String getRecommend_reason() {
            return recommend_reason;
        }

        public void setRecommend_reason(String recommend_reason) {
            this.recommend_reason = recommend_reason;
        }

        public OrderDetailData getTempOrderData() {
            return tempOrderData;
        }

        public void setTempOrderData(OrderDetailData tempOrderData) {
            this.tempOrderData = tempOrderData;
        }

        public boolean isShowAllExpress() {
            return isShowAllExpress;
        }

        public void setShowAllExpress(boolean showAllExpress) {
            isShowAllExpress = showAllExpress;
        }

        @Override
        public Object clone() throws CloneNotSupportedException {
            OrderDetailList data = (OrderDetailList) super.clone();
            return data;
        }
    }

    public static class OrderDetailStores {
        private String id;
        private String name;
        private String address;
        private String status;
        private String toilet_position;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getToilet_position() {
            return toilet_position;
        }

        public void setToilet_position(String toilet_position) {
            this.toilet_position = toilet_position;
        }
    }

    public static class OrderExpress {
        private String id;
        private String order_id;
        //最后一次更新时间
        private String last_get_time;
        private List<OrderExpressList> express_json;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getOrder_id() {
            return order_id;
        }

        public void setOrder_id(String order_id) {
            this.order_id = order_id;
        }

        public String getLast_get_time() {
            return last_get_time;
        }

        public void setLast_get_time(String last_get_time) {
            this.last_get_time = last_get_time;
        }

        public List<OrderExpressList> getExpress_json() {
            return express_json;
        }

        public void setExpress_json(List<OrderExpressList> express_json) {
            this.express_json = express_json;
        }
    }

    public static class OrderExpressList {
        private String time;
        private String ftime;
        private String context;

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public String getFtime() {
            return ftime;
        }

        public void setFtime(String ftime) {
            this.ftime = ftime;
        }

        public String getContext() {
            return context;
        }

        public void setContext(String context) {
            this.context = context;
        }
    }
}
